package net.wexoo.onlinedivelog.reusable;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.markup.html.form.Form;
/**
 * SameActionOnClickAjaxButton.java
 * 
 * @author wexoo
 * @since 1.0.0 Nov 19, 2011
 */
public abstract class SameActionOnClickAjaxButton extends AjaxButton {
  private static final long serialVersionUID = 1L;

  public SameActionOnClickAjaxButton(String id) {
    super(id);
  }

  @Override
  protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
    doOnClickAction(target, form);
  }

  @Override
  protected void onError(AjaxRequestTarget target, Form<?> form) {
    doOnClickAction(target, form);
  }

  protected abstract void doOnClickAction(AjaxRequestTarget target, Form<?> form);
}
